

import java.util.LinkedList;

/**
 * Created with IntelliJ IDEA.
 * Description:
 * User: ling
 * Date: 2022-04-22
 * Time: 20:49
 */
public class WorkerTest {
    public static void main(String[] args) {
        LinkedList list=new LinkedList<Employee>();
        Employee worker1=new YearWorker("张一鸣",500000.0);
        Employee worker2=new YearWorker("李天生",850000.0);
        Employee worker3=new MonthWorker("王菲菲",6800.0);
        Employee worker4=new MonthWorker("周铭",9800.0);
        Employee worker5=new MonthWorker("胡一统",10400.0);
        list.add(worker1);
        list.add(worker2);
        list.add(worker3);
        list.add(worker4);
        list.add(worker5);
       double total=worker1.earnings()+worker2.earnings()+worker3.earnings()+worker4.earnings()+worker5.earnings();
        System.out.println("天元软件开发公司3月份薪水支出是"+total);
    }
}
